package com.spddr.pmos.jpa;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class UsagePointAggregateId implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private long trunk;
	private long branch;

	public UsagePointAggregateId() {
	}

	public UsagePointAggregateId(long trunk, long branch) {
		this.trunk = trunk;
		this.branch = branch;
	}

	@Column(name = "trunk", nullable = false)
	public long getTrunk() {
		return this.trunk;
	}

	public void setTrunk(long trunk) {
		this.trunk = trunk;
	}

	@Column(name = "branch", nullable = false)
	public long getBranch() {
		return this.branch;
	}

	public void setBranch(long branch) {
		this.branch = branch;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (branch ^ (branch >>> 32));
		result = prime * result + (int) (trunk ^ (trunk >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UsagePointAggregateId other = (UsagePointAggregateId) obj;
		if (branch != other.branch)
			return false;
		if (trunk != other.trunk)
			return false;
		return true;
	}
}